package br.com.vti.leilao.model.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.Size;

/**
 * Anotação utilizada para validar o campo cpf.
 * 
 * @author Ednardo Rubens
 * 
 */
@Documented
@Size(min = 11, max = 11)
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = ValidatorCPF.class)
public @interface CPF {

    String message() default "{br.com.vti.model.annotation.CPF.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
